/**
 * 
 */
package stc.skymobi.bean.xip.test;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import stc.skymobi.transport.DefaultEndpointFactory;


/**
 * @author hp
 *
 */
public class XipDemo {

    public static void main(String[] args) {
        AbstractApplicationContext ctx = new ClassPathXmlApplicationContext(
            	"com/skymobi/bean/xip/test/xipDemo.xml");

        SampleSsip ssip = new SampleSsip();
        
        ssip.setName("hello, world!");
        
    	DefaultEndpointFactory sender = (DefaultEndpointFactory)ctx.getBean("endpointFactory");
    	
    	while (true) {
    		sender.send(ssip);
    		try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
    	}
    }
}
